import Vue from 'vue'
import Router from 'vue-router'
import Main from '@/components/Main'
import Detail from '../components/Detail.vue'
import User from '../components/User.vue'
import Knowledge from '../components/Knowledge.vue'
import News from '../components/News.vue'
import Music from '../components/Music.vue'
import Network from '../components/Network.vue'

Vue.use(Router) //use()调用插件的install方法

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Main',
      component: Main
    },
    {
      path:'/Detail',
      name:'Detail',
      component:Detail
    },
    {
      path:'/User',
      name:'User',
      component:User,
      children:[
        {
          path:'/User',
          redirect:'/User/News'
        },
        {
         path:'/User/Knowledge',
         component:Knowledge
        },
        {
          path:'/User/News',
          component:News
        },
        {
          path:'/User/Network',
          component:Network
        },
        {
          path:'/User/Music',
          component:Music
        }
      ]
    }
  ]
})
